home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mint96sb.zoo / src / makefile < prev    next >
Encoding:
Makefile  |  1992-10-15  |  4.4 KB  |  170 lines

  1. #
  2. # Makefile for MiNT using the GCC
  3. #
  4.  
  5. # if you're cross-compiling, define NATIVECC
  6. # to the host's C compiler, NATIVECFLAGS to
  7. # the appropriate flags for it, and NATIVELIBS
  8. # to appropriate libraries
  9. # NATIVECC = cc -DNO_STDLIB
  10. # NATIVECFLAGS = -g
  11. # NATIVELIBS =
  12.  
  13. NATIVECC = gcc
  14. NATIVECFLAGS = -O
  15. NATIVELIBS = -liio
  16.  
  17. #
  18. # depending on your version of bison/yacc, you may
  19. # need to change these names, e.g. to
  20. # YACC = yacc
  21. # YTABC = y.tab.c
  22. # YTABH = y.tab.h
  23.  
  24. YACC = bison -d
  25. YTABC = asm_tab.c
  26. YTABH = asm_tab.h
  27.  
  28. # here are defs for the cross compiler
  29. # MiNT must be compiled with 16 bit integers
  30.  
  31. CC = gcc
  32. MODEL = -mshort
  33. LIBS = -liio16
  34.  
  35. # add -DEZMINT for smaller MiNT
  36.  
  37. DEFS = -DFASTTEXT -DOWN_LIB
  38.  
  39. #
  40. # if you have an older version of gcc, it won't understand -G;
  41. # that won't hurt anything (it just controls the format of the
  42. # symbol table) so just delete the -G. Do *not* change it into
  43. # -g!!!
  44. #
  45. CFLAGS = -G -Wall -O2 -fomit-frame-pointer $(MODEL) $(DEFS)
  46.  
  47.  
  48. COBJS = bios.o xbios.o console.o dos.o dosdir.o dosfile.o dosmem.o dossig.o \
  49.     filesys.o main.o mem.o proc.o signal.o timeout.o tty.o util.o \
  50.     biosfs.o pipefs.o procfs.o tosfs.o debug.o rendez.o \
  51.     unifs.o shmfs.o fasttext.o
  52.  
  53. CSRCS = bios.c xbios.c console.c dos.c dosdir.c dosfile.c dosmem.c dossig.c \
  54.     filesys.c main.c mem.c proc.c signal.c timeout.c tty.c util.c \
  55.     biosfs.c pipefs.c procfs.c tosfs.c debug.c rendez.c \
  56.     unifs.c shmfs.c fasttext.c
  57.  
  58. SOBJS = context.o intr.o syscall.o quickzer.o quickmov.o cpu.o
  59.  
  60. OBJS = $(COBJS) $(SOBJS)
  61.  
  62. mint.prg: $(OBJS)
  63.     $(CC) $(CFLAGS) -o mint.prg $(OBJS) $(LIBS)
  64.  
  65. $(SOBJS): proc.h
  66. $(COBJS): mint.h proc.h file.h
  67.  
  68. main.o: version.h
  69. bios.o: inline.h
  70.  
  71. #
  72. # assembler source files are now handled in a radically different
  73. # fashion. We build a pre-processor program, asmtrans, that
  74. # takes the .spp files, merges them with an include file that
  75. # gives various offsets into structures of interest, and produces
  76. # the .s files as output. This has two major advantages:
  77. # (1) it lets us use the same source for both the Lattice and
  78. #     gcc assembler files (the translator will convert), and
  79. # (2) if we change the CONTEXT or PROC structures, we don't
  80. #     have to dig through the source code looking for
  81. #     magic numbers
  82.  
  83. # the asm translator program
  84. # Note that this must be compiled with the native CC of whatever
  85. # system you're using; see the definitions at the top of this
  86. # file.
  87.  
  88. ATRANSOBJ = asmtab.o trutil.o trans.o
  89. ATRANS = asmtrans.ttp
  90.  
  91. $(ATRANS): $(ATRANSOBJ)
  92.     $(NATIVECC) $(NATIVECFLAGS) -o $(ATRANS) $(ATRANSOBJ) \
  93.         $(NATIVELIBS)
  94.  
  95. asmtab.o: asmtab.c asmtrans.h
  96.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
  97.  
  98. trutil.o: trutil.c asmtrans.h
  99.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
  100.  
  101. trans.o: trans.c asmtrans.h
  102.     $(NATIVECC) $(NATIVECFLAGS) -o $@ -c $<
  103.  
  104.  
  105. asmtab.c asmtab.h:    asm.y
  106.     $(YACC) asm.y
  107.     mv $(YTABC) asmtab.c
  108.     mv $(YTABH) asmtab.h
  109.  
  110. # the magic number include file is generated automagically
  111. # NOTE that of course, magic.i can only reliably be generated
  112. # on an Atari ST; if you're cross-compiling, you'll have
  113. # to edit magic.i by hand
  114. # for cross compilers; uncomment the following definitions
  115. # and comment out the other ones below
  116.  
  117. # for cross-compiling
  118.  
  119. # GENMAGICPRG=echo
  120. # magic.i: proc.h file.h genmagic.c
  121. #    echo "Warning: magic.i may be out of date"
  122.  
  123. #for native compiling
  124.  
  125. GENMAGICPRG=genmagic.ttp
  126.  
  127. $(GENMAGICPRG): genmagic.c proc.h file.h
  128.     $(CC) $(CFLAGS) -DGENMAGIC -o $(GENMAGICPRG) genmagic.c
  129.  
  130. magic.i: $(GENMAGICPRG)
  131.     $(GENMAGICPRG) $@
  132.  
  133. #
  134. # assembler source files
  135. #
  136. .SUFFIXES: .spp
  137.  
  138. .spp.s:
  139.     $(ATRANS) -gas -o $@ $<
  140.  
  141. context.o: context.spp magic.i $(ATRANS)
  142. intr.o: intr.spp magic.i $(ATRANS)
  143. syscall.o: syscall.spp magic.i $(ATRANS)
  144. quickzer.o: quickzer.spp $(ATRANS)
  145. quickmov.o: quickmov.spp $(ATRANS)
  146. cpu.o: cpu.spp $(ATRANS)
  147.  
  148. #
  149. # mkptypes generates prototypes from C source code. If you don't have it,
  150. # you'll have to add/delete function prototypes by hand.
  151. # also: Sozobon users will have to edit proto.h by hand to change the
  152. #    #if defined(__STDC__) || defined(__cplusplus)
  153. # line into
  154. #    #if __STDC__
  155. #
  156. proto.h: $(CSRCS)
  157.     mkptypes $(CSRCS) >proto.h
  158.  
  159. #
  160. # macros for cleaning up
  161. #
  162. GENFILES= $(OBJS) $(ATRANSOBJ) $(ATRANS) $(GENMAGICPRG)
  163. EXTRAS= asmtab.c asmtab.h mint.prg
  164.  
  165. clean:
  166.     $(RM) $(GENFILES)
  167.  
  168. realclean:
  169.     $(RM) $(GENFILES) $(EXTRAS)
  170.